package com.example.chapter08;



import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
import javax.servlet.ServletRequestEvent;
import javax.servlet.ServletRequestListener;

public class MyListener implements ServletContextListener, HttpSessionListener, ServletRequestListener {

    @Override
    public void contextInitialized(ServletContextEvent arg0) {
        System.out.println("ServletContext对象被创建了");
    }

    @Override
    public void contextDestroyed(ServletContextEvent arg0) {
        System.out.println("ServletContext对象被销毁了");
    }

    @Override
    public void sessionCreated(HttpSessionEvent arg0) {
        System.out.println("Session对象被创建了");
    }

    @Override
    public void sessionDestroyed(HttpSessionEvent arg0) {
        System.out.println("Session对象被销毁了");
    }

    @Override
    public void requestInitialized(ServletRequestEvent arg0) {
        System.out.println("ServletRequest对象被创建了");
    }

    @Override
    public void requestDestroyed(ServletRequestEvent arg0) {
        System.out.println("ServletRequest对象被销毁了");
    }
}